?><?
class entity_fabricue{

	var $data=array();

	function __get($name){
		if(!isset($this->data[$name])){
			$entity_name="cls_".$name;
			$entity=new $entity_name();
			$this->data[$name]=$entity;
		}
		return $this->data[$name];
	}
}
function db($entity){
	if(!isset($GLOBALS["entity_fabricue"])){
		$GLOBALS["entity_fabricue"]=new entity_fabricue();
	}
	$ef=$GLOBALS["entity_fabricue"];
	return $ef->{$entity};
}
